package game.game.network.cmd;

import json.JSONObject;
import entity.Context;
import entity.Position;
import game.engine.network.cmd.CmdClient;
import game.engine.network.cmd.EnumCommand;
import game.engine.network.server.IControllerServer;

public class CmdCGetCacheMap extends CmdClient
{

	public CmdCGetCacheMap(JSONObject pObject)
	{
		super( pObject );
	}

	public CmdCGetCacheMap(Context pContext, Position pPosition)
	{
		super( EnumCommand.CMD_CLIENT_GET_CACHE_MAP, pContext );
		addParam( CmdSReturnPosition.POSITIONX , pPosition.getX() );
		addParam( CmdSReturnPosition.POSITIONY , pPosition.getY() );
	}

	@Override
	public void execute( IControllerServer pController )
	{
		pController.execute( this );
	}

	public Integer getPositionX()
	{
		return (Integer) getParam( CmdSReturnPosition.POSITIONX );
	}

	public Integer getPositionY()
	{
		return (Integer) getParam( CmdSReturnPosition.POSITIONY );
	}

}
